﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="Taikhoan.aspx.cs" Inherits="Admin_Taikhoan" Title="Quản lý tài khoản" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link rel="Stylesheet" href="/Online/CSS/Admin.css" type="text/css" />
    <style type="text/css">
        #pnNhap
        {
            margin-top: 10px;
        }
        .GV
        {
            color: White;
            font-size: 17px;
        }
        .GV2
        {
            margin-left: 10px;
        }
        .GV1
        {
            border: 1px solid #333;
            border-left-style: hidden;
            border-right-style: hidden;
            border-bottom-style: hidden;
        }
        .abc
        {
            font-size: 17px;
            text-align: left;
            font-weight: normal;
        }
        .ck
        {
            color: White;
            font-size: 17px;
        }
        .hoten
        {
            margin-left: 10px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="height: 100%;">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="pnanel" runat="server">
            <ContentTemplate>
                <div class="tieude">
                    QUẢN LÝ TÀI KHOẢN</div>
                <div style="margin-left: 10px; color: White; font-size: 17px; margin-top: 10px;">
                    <%--Chọn loại tài khoản:--%>
                    <asp:DropDownList ID="chonloaitk" runat="server" Width="130px" AutoPostBack="true" Visible="false"
                        OnSelectedIndexChanged="chonloaitk_SelectedIndexChanged">
                        <asp:ListItem Value="2">Tất cả</asp:ListItem>
                        <asp:ListItem Value="1">Nhân viên</asp:ListItem>
                        <asp:ListItem Value="0">Thành viên</asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div style="margin-top: 10px; border-bottom: 1px solid #333; width: 100%; height: 100%;">
                    <asp:GridView ID="GVTK" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        DataKeyNames="Taikhoan" CssClass="GV1" PageSize="8" Width="100%" PagerStyle-CssClass="GV"
                        PagerStyle-ForeColor="White">
                        <Columns>
                            <asp:TemplateField HeaderText="Xóa" HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:CheckBox ID="ckq1" runat="server" />
                                </ItemTemplate>
                                <ControlStyle Width="30px" />
                                <ItemStyle HorizontalAlign="Center" />
                                <HeaderStyle HorizontalAlign="Center" />
                                <HeaderStyle ForeColor="White" />
                                <ItemStyle ForeColor="White" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tài khoản">
                                <ItemTemplate>
                                    <asp:HyperLink ID="tk" runat="server" Text='<%#Eval("Taikhoan") %>' NavigateUrl='<%#"/Online/Admin/Taikhoan.aspx?"+"ac="+Eval("Taikhoan") %>'
                                        CssClass="HyperLink1"></asp:HyperLink>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Center" />
                                <HeaderStyle ForeColor="White" />
                                <ItemStyle ForeColor="White" />
                                <ControlStyle ForeColor="White" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Họ tên">
                                <ItemTemplate>
                                    <asp:Label ID="ht" runat="server" CssClass="hoten" Text='<%#Eval("Hoten") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Center" />
                                <HeaderStyle ForeColor="White" />
                                <ItemStyle ForeColor="White" />
                                <ControlStyle ForeColor="White" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Giới tính">
                                <ItemTemplate>
                                    <asp:Label ID="gt" runat="server" CssClass="hoten" Text='<%#Eval("Gioitinh") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                                <ItemStyle Width="75px" />
                                <HeaderStyle HorizontalAlign="Center" />
                                <HeaderStyle ForeColor="White" />
                                <ItemStyle ForeColor="White" />
                                <ControlStyle ForeColor="White" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ngày sinh">
                                <ItemTemplate>
                                    <asp:Label ID="ns" runat="server" CssClass="hoten" Text='<%# DataBinder.Eval(Container.DataItem, "Ngaysinh", "{0:dd/MM/yyyy}")%> '></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Center" />
                                <HeaderStyle ForeColor="White" />
                                <ItemStyle ForeColor="White" />
                                <ControlStyle ForeColor="White" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Địa chỉ">
                                <ItemTemplate>
                                    <asp:Label ID="dc" runat="server" CssClass="hoten" Text='<%#Eval("Diachi") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Center" />
                                <HeaderStyle ForeColor="White" />
                                <ItemStyle ForeColor="White" />
                                <ControlStyle ForeColor="White" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Email">
                                <ItemTemplate>
                                    <asp:Label ID="email" runat="server" CssClass="hoten" Text='<%#Eval("Email") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Center" />
                                <HeaderStyle ForeColor="White" />
                                <ItemStyle ForeColor="White" />
                                <ControlStyle ForeColor="White" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
                <div>
                    <asp:Panel ID="pnAdd" runat="server">
                        <table width="100%" style="color: White; margin: 5px;">
                            <tr>
                                <td>
                                    Tài khoản
                                </td>
                                <td>
                                    <asp:TextBox ID="txtTaiKhoan" runat="server" Width="200px"></asp:TextBox>
                                </td>
                                <td>
                                    Giới tính
                                </td>
                                <td>
                                    <asp:RadioButton ID="rdNam" runat="server" GroupName="sex" Text="Nam" Checked="true" />
                                    <asp:RadioButton ID="rdNu" runat="server" GroupName="sex" Text="Nữ" Checked="false" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Mật khẩu
                                </td>
                                <td>
                                    <asp:TextBox ID="txtMatKhau1" TextMode="Password" runat="server" Width="200px"></asp:TextBox>
                                </td>
                                <td>
                                    Ngày sinh
                                </td>
                                <td>
                                    <asp:TextBox ID="txtNgaySinh" runat="server" Width="200px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Xác nhận lại mật khẩu
                                </td>
                                <td>
                                    
                                    <asp:TextBox ID="txtMatKhau2" TextMode="Password" runat="server" Width="200px"></asp:TextBox>
                                </td>
                                <td>
                                    Địa chỉ
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDiaChi" runat="server" Width="200px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Họ tên
                                </td>
                                <td>
                                    <asp:TextBox ID="txtHoTen" runat="server" Width="200px"></asp:TextBox>
                                </td>
                                <td>
                                    Email
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEmail" runat="server" Width="200px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <asp:Button ID="btnThem1" runat="server" Width="80px" Text="Lưu lại" OnClick="btnThem1_Click" />
                                    <asp:Button ID="btnSua1" runat="server" Width="80px" Text="Sửa" OnClick="btnSua1_Click" />
                                    <asp:Button ID="btnXoa1" runat="server" Text="Xóa" Width="80px" OnClick="btnXoa1_Click" />
                                    <asp:Button ID="btnHuy1" runat="server" Text="Hủy" Width="80px" OnClick="btnHuy1_Click" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </div>
                <div>
                    <asp:Panel ID="Edit" runat="server">
                        <div style="margin-top: 15px;">
                            <div style="width: 485px; float: left; margin-left: 20px;">
                                <asp:Button ID="btnHuy" runat="server" Text="Hủy quyền" OnClick="btnHuy_Click" />
                                <asp:CheckBox ID="ckChon1" runat="server" Text="Chọn/Bỏ tất cả" AutoPostBack="true"
                                    OnCheckedChanged="ckChon1_CheckedChanged" CssClass="ck" />
                            </div>
                            <div style="width: 485px; float: left; margin-left: 20px;">
                                <asp:Button ID="btnThem" runat="server" Text="Thêm quyền" OnClick="btnThem_Click" />
                                <asp:CheckBox ID="ckChon2" runat="server" Text="Chọn/Bỏ tất cả" AutoPostBack="true"
                                    OnCheckedChanged="ckChon2_CheckedChanged" CssClass="ck" />
                            </div>
                        </div>
                        <div style="margin-top: 15px;">
                            <!--begin 1 div-->
                            <div class="tieude" style="width: 505px; height: 100%; float: left; font-size: 18px;
                                text-align: left; text-transform: none; border: 1px solid #333; border-left-style: hidden;
                                -webkit-border-radius: 0px 5px 5px 0px;">
                                <div style="text-align: center;">
                                    <asp:Label ID="tdpq" runat="server"></asp:Label>
                                </div>
                                <asp:GridView ID="gvsd" runat="server" AllowPaging="false" AutoGenerateColumns="False"
                                    DataKeyNames="Machucnang" CssClass="GV1" Width="505px" PagerStyle-ForeColor="White">
                                    <Columns>
                                        <asp:TemplateField HeaderText="Chọn quyền" HeaderStyle-HorizontalAlign="Left">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="ckq1" runat="server" Checked="true" />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <HeaderStyle ForeColor="White" />
                                            <ItemStyle ForeColor="White" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="ID" Visible="false">
                                            <ItemTemplate>
                                                <asp:Label ID="macn" runat="server" Text='<%#Eval("Machucnang") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <HeaderStyle ForeColor="White" />
                                            <ItemStyle ForeColor="White" />
                                            <ControlStyle ForeColor="White" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Chức năng">
                                            <ItemTemplate>
                                                <asp:Label ID="tencn" runat="server" Text='<%#Eval("Tenchucnang") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <HeaderStyle ForeColor="White" />
                                            <ItemStyle ForeColor="White" />
                                            <ControlStyle Width="350px" />
                                            <ItemStyle CssClass="abc" />
                                            <ControlStyle ForeColor="White" />
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </div>
                            <!--het 1 div-->
                            <!--begin 1 div-->
                            <div class="tieude" style="width: 505px; height: 100%; float: left; font-size: 18px;
                                text-align: left; text-transform: none; margin-left: 10px; border: 1px solid #333;
                                border-right-style: hidden; -webkit-border-radius: 5px 0px 0px 5px;">
                                <div style="text-align: center;">
                                    <asp:Label ID="tdpq2" runat="server"></asp:Label>
                                </div>
                                <asp:GridView ID="gvksd" runat="server" AllowPaging="false" AutoGenerateColumns="False"
                                    DataKeyNames="Machucnang" CssClass="GV1" Width="505px" PagerStyle-ForeColor="White">
                                    <Columns>
                                        <asp:TemplateField HeaderText="Chọn quyền" HeaderStyle-HorizontalAlign="Left">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="ckq2" runat="server" Checked="false" />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <HeaderStyle ForeColor="White" />
                                            <ItemStyle ForeColor="White" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="ID" Visible="false">
                                            <ItemTemplate>
                                                <asp:Label ID="macn" runat="server" Text='<%#Eval("Machucnang") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <HeaderStyle ForeColor="White" />
                                            <ItemStyle ForeColor="White" />
                                            <ControlStyle ForeColor="White" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Chức năng">
                                            <ItemTemplate>
                                                <asp:Label ID="tencn" runat="server" Text='<%#Eval("Tenchucnang") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <HeaderStyle ForeColor="White" />
                                            <ItemStyle ForeColor="White" />
                                            <ControlStyle Width="350px" />
                                            <ItemStyle CssClass="abc" />
                                            <ControlStyle ForeColor="White" />
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </div>
                            <!--het 1 div-->
                        </div>
                        <div style="width: 1024px; margin-top: 20px; float: left; height: 30px; text-align: center;
                            color: White; font-size: 17px;">
                            <asp:Label ID="tb" runat="server"></asp:Label>
                        </div>
                    </asp:Panel>
                </div>
                
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdateProgress ID="pro" runat="server" AssociatedUpdatePanelID="pnanel">
        </asp:UpdateProgress>
    </div>
</asp:Content>
